extends Card

# 再生术 - 每回合开始恢复5血，持续5回合

func get_default_tooltip() -> String:
	return tooltip_text

func get_updated_tooltip(player_modifiers: ModifierHandler, enemy_modifiers: ModifierHandler) -> String:
	return tooltip_text

func apply_effects(targets: Array[Node], modifiers: ModifierHandler) -> void:
	# 应用再生效果
	if scheduled_effect and targets and targets.size() > 0:
		var target_node = targets[0]
		if target_node and target_node.is_inside_tree():
			var battle = target_node.get_tree().get_first_node_in_group("battle")
			if battle and battle.resource_scheduler:
				var effect_instance = scheduled_effect.duplicate()
				
				# 可以根据修改器调整治疗量
				for stat_mod in effect_instance.stat_modifications:
					if stat_mod.stat_name == "health":
						# 治疗效果受到修改器影响
						var base_heal = stat_mod.value
						var modified_heal = modifiers.get_modified_value(int(base_heal), Modifier.Type.DMG_DEALT)
						stat_mod.value = float(modified_heal)
				
				battle.resource_scheduler.add_scheduled_effect(effect_instance)
				print("🌿 再生术激活：每回合开始恢复5血，持续5回合")
	
	super.apply_effects(targets, modifiers) 
